﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AreaEdit.aspx.cs" Inherits="Card.Manager.AreaEdit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>添加地区</title>
    <link href="Css/Style.css" rel="stylesheet" type="text/css" />

    <script src="JavaScript/jquery-1.8.3.min.js" type="text/javascript"></script>

    <script type="text/javascript" language="javascript">
       function xuanze(obj){
          var ckXuanze=document.getElementsByName("ckXuanze");
          for(i=0;i<ckXuanze.length;i++){
             ckXuanze[i].checked=obj.checked;
          }
       }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    
        <table class="TB">
            <tr>
                <td colspan="4" class="TB_Header">
                    地区</td>
            </tr>
            <tr>
                <td colspan="4" class="TD_Input">
                </td>
            </tr>
            <tr>
                <td class="TD_Input_Text">
                    地区名称：
                </td>
                <td class="TD_Input">
                    <asp:TextBox ID="txtName" runat="server" Width="146px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="reqname" runat="server" ErrorMessage="请填写地区名称" ControlToValidate="txtName"></asp:RequiredFieldValidator>
                </td>
                <td class="TD_Input_Text">
                    父地区：
                </td>
                <td class="TD_Input">                 
                    <asp:DropDownList ID="dropParent" runat="server"  Enabled="false"></asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="TD_Input_Text">
                    地区级别：
                </td>
                <td class="TD_Input">
                    <asp:DropDownList ID="dropAreaType" AutoPostBack="true" runat="server" Enabled="false">
                        <asp:ListItem Value="1">省</asp:ListItem>
                        <asp:ListItem Value="2">地/市</asp:ListItem>
                        <asp:ListItem Value="3">区县/市</asp:ListItem>
                    </asp:DropDownList>
                </td>
               <td class="TD_Input_Text">
                    排序：
                </td>
                <td class="TD_Input">
                    <asp:TextBox ID="txtSort" Text="1" runat="server"></asp:TextBox>
                </td>
                
            </tr>
            <tr> <td  class="TD_Input_Text">
                    分站代码
                </td>
                <td>
                    <asp:TextBox ID="txtSiteCode" Enabled="false" runat="server"  MaxLength="20"></asp:TextBox>
                </td>
                <td class="TD_Input_Text">
                    分站地址：
                </td>
                <td class="TD_Input">
                    <asp:TextBox ID="txtURL"  Enabled="false" runat="server" Width="144px"></asp:TextBox>
                </td>
                
            </tr>
            <tr><td class="TD_Input_Text">
                    是否开通：
                </td>
                <td class="TD_Input">
                    <asp:DropDownList  Enabled="false" ID="dropIsActive" runat="server">
                        <asp:ListItem Value="N">不开通</asp:ListItem>
                        <asp:ListItem Value="Y">开通</asp:ListItem>
                    </asp:DropDownList>
                </td>                            
            </tr>
           
            <tr>
                <td class="TD_Input" colspan="4" align="center">
                    <asp:Button ID="btn_save" OnClientClick="javascript:return confirm('确认保存？');" runat="server"
                        Text="保 存" OnClick="btn_save_Click" Style="height: 26px" />
                    <input style="height: 26px" type="button" onclick="javascript:window.location='AreaManager.aspx';"
                        value="返回" />
                </td>
            </tr>
        </table>
        <table class="TB">
            <tr>
                <td colspan="4" class="TB_Header">
                    地区排序
                </td>
            </tr>
            <tr>
                <td colspan="4">
                    <asp:Repeater ID="rptList" runat="server">
                        <HeaderTemplate>
                            <table class="TB">
                                <tr class="TB_Header">
                                    <td>
                                        选择<input type="checkbox" checked="checked" onclick="xuanze(this)" />
                                    </td>
                                    <td>
                                        排序
                                    </td>
                                    <td>
                                        名称
                                    </td>
                                    <td>
                                        操作
                                    </td>
                                </tr>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <tr class="TB_Item">
                                <td>
                                    <input type="checkbox" checked="checked" name="ckXuanze" value='<%# Eval("ID") %>' />
                                </td>
                                <td>
                                    <input type="text" value='<%# Eval("SORT")%>' name='txtSort<%# Eval("ID") %>' maxlength="4"
                                        style="width: 20px;" />
                                </td>
                                <td>
                                    <%# Eval("NAME")%>
                                </td>
                                <td>
                                    <a href='?id=<%# Eval("ID") %>'>编辑</a>
                                </td>
                            </tr>
                        </ItemTemplate>
                        <AlternatingItemTemplate>
                            <tr class="TB_Alter">
                                <td>
                                    <input type="checkbox" checked="checked" name="ckXuanze" value='<%# Eval("ID")%>' />
                                </td>
                                <td>
                                    <input type="text" value='<%# Eval("SORT")%>' name='txtSort<%# Eval("ID") %>' maxlength="4"
                                        style="width: 20px;" />
                                </td>
                                <td>
                                    <%# Eval("NAME")%>
                                </td>
                                 <td>
                                    <a href='?id=<%# Eval("ID") %>'>编辑</a>
                                </td>
                            </tr>
                        </AlternatingItemTemplate>
                        <FooterTemplate>
                            </table>
                        </FooterTemplate>
                    </asp:Repeater>
                </td>
            </tr>
            <tr>
                <td class="TD_Input" colspan="4" align="center">
                    <asp:Button ID="btnOrder" runat="server" Text="修改排序" Style="height: 26px" OnClick="btnOrder_Click" />
                </td>
            </tr>
        </table>
    </form>
</body>
